package org.backend.repository;

import org.backend.pojo.entity.User;
import org.backend.pojo.entity.WxUser;
import org.backend.mapper.UserMapper;
import org.backend.pojo.vo.WxUserInfoVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

@Repository
public class UserRepository {

    @Autowired
    private UserMapper userMapper;

    public User findUserByAccount(String account) {
        return userMapper.findUserByAccount(account);
    }

    public User findUserByUserId(Integer userId) {
        return userMapper.findUserByUserId(userId);
    }

    public void insertUser(User user) {
        userMapper.insertUser(user);
    }

    public int saveUserInfo(User user) {
        return userMapper.saveUserInfo(user);
    }

    public void insertWxUser(WxUser wxUser) {
        userMapper.insertWxUser(wxUser);
    }

    public WxUser getByOpenid(String openid) {
        return userMapper.getByOpenid(openid);
    }

    public WxUser findWxUserByOpenId(String openId) {
        return userMapper.findWxUserByOpenId(openId);
    }

    public int editWxUserInfo(WxUser wxUser) {
        return userMapper.editWxUserInfo(wxUser);
    }
}
